package yuhao.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class JdbcDemo2 {
    public static void main(String[] args) throws Exception {

        Class.forName("com.mysql.jdbc.Driver");
        String url = "jdbc:mysql://127.0.0.1/db6?useSSl=false";
        String user = "root";
        String password = "1234";

        Connection connection = DriverManager.getConnection(url, user, password);
        String sql = "UPDATE account  SET money=2000 where id=1";
        Statement sta = connection.createStatement();
        int i = sta.executeUpdate(sql);
        System.out.println(i);
        sta.close();
        connection.close();
    }
}
